Skip to content

[3.14] gh-159739: Keep descriptor metadata dictionaries alive during insertion (GH-160193) - #160383

Merged
JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-a076a55-3.14
Oct 23, 2026
Merged

JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-a076a55-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The classmethod and staticmethod metadata setters dropped their reference to the descriptor dictionary before inserting the new value. A key comparison or value finalizer can replace the dictionary during insertion, leaving the operation using released memory. Keep the dictionary alive until insertion finishes. Backport to 3.15 and 3.14.
(cherry picked from commit a076a55)

Co-authored-by: Jelle Zijlstra jelle@openai.com

…nsertion (pythonGH-160193)

The classmethod and staticmethod metadata setters dropped their reference to the descriptor dictionary before inserting the new value. A key comparison or value finalizer can replace the dictionary during insertion, leaving the operation using released memory. Keep the dictionary alive until insertion finishes. Backport to 3.15 and 3.14.
(cherry picked from commit a076a55)

Co-authored-by: Jelle Zijlstra <jelle@openai.com>
@JelleZijlstra
JelleZijlstra merged commit a2916fe into python:3.14 Oct 23, 2026
51 checks passed
@miss-islington
miss-islington deleted the backport-a076a55-3.14 branch October 23, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants